import java.io.File;

public class DeleteAll {
    public static void main(String[] args) {

        File file = new File("E:\\XmpCache");

        deleteAll(file);

    }

    public static void deleteAll(File file) {
        if (file.isFile()) {
            file.delete();
        } else if (file.isDirectory()) {
            File[] files = file.listFiles();
            for (File f : files
            ) {
                deleteAll(f);
            }
            file.delete();
        }

    }


}
